package Myoopextends.a03tset03;

public class Test{
    public static void main(String[] args) {
        //创建对象
        Husky h = new Husky();
        h.eat();
        h.breakHome();
        h.drink();
        h.lookHome();


        SharPei sp = new SharPei();
        sp.eat();
        sp.drink();
        sp.lookHome();


        ChineseDog cd = new ChineseDog();
        cd.eat();
        cd.drink();
        cd.lookHome();
    }
}

 class Dog {
    public void eat(){
        System.out.println("狗在吃狗粮");
    }

    public void drink(){
        System.out.println("狗在喝水");
    }

    public void lookHome(){
        System.out.println("狗在看家");
    }
}


class Husky extends Dog{
    public void breakHome(){
        System.out.println("哈士奇在拆家");
    }
}

class SharPei extends Dog{
    @Override
    public void eat() {
        super.eat();
        System.out.println("沙皮狗在吃骨头");
    }
}


class ChineseDog extends Dog{
    @Override
    public void eat() {
        System.out.println("中华田园犬在吃剩饭");
    }
}
